package com.itzhigui.controller;

import com.itzhigui.entity.Student2;
import com.itzhigui.service.Student2Service;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author java1412
 * @since 2023-11-08 11:09:32
 */
@RestController
@Slf4j
@CrossOrigin
public class Student2Controller {
    @Resource
    private Student2Service student2Service;

    @GetMapping(value = "/student2/list")
    public Object findAll() {
        return student2Service.findAll();
    }

    @GetMapping(value = "/student2/findById")
    public Object findById(Integer id) {
        return student2Service.findById(id);
    }

    @PostMapping(value = "/student2/add")
    public Object add(@RequestBody Student2 student2) {
        return student2Service.add(student2);
    }
}
